var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function r() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (r.prototype = e.prototype, 
    new r());
}), a = this && this.__decorate || function(t, e, o, r) {
    var n, a = arguments.length, c = a < 3 ? e : null === r ? r = Object.getOwnPropertyDescriptor(e, o) : r;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(t, e, o, r); else for (var i = t.length - 1; 0 <= i; i--) (n = t[i]) && (c = (a < 3 ? n(c) : 3 < a ? n(e, o, c) : n(e, o)) || c);
    return 3 < a && c && Object.defineProperty(e, o, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameManager"), s = cc._decorator, c = s.ccclass, l = s.property, d = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.camera = null, t.player = null, t.bg = null, t;
    }
    return i(t, e), t.prototype.start = function() {}, t.prototype.updatePos = function(t) {
        var e, o;
        void 0 === t && (t = this.camera.zoomRatio), r.default.getInstance().gameView && r.default.getInstance().gameView.followPlayer && (e = r.default.getInstance().gameView.followPlayer.node.getPosition(), 
        o = Math.abs((cc.winSize.width / t - this.bg.width * this.bg.scale) / 2), t = Math.abs((cc.winSize.height / t - this.bg.height * this.bg.scale) / 2), 
        e.x > o ? e.x = o : e.x < -o && (e.x = -o), e.y > t ? e.y = t : e.y < -t && (e.y = -t), 
        this.node.setPosition(e));
    }, t.prototype.update = function() {
        this.updatePos();
    }, a([ l(cc.Camera) ], t.prototype, "camera", void 0), a([ l(cc.Node) ], t.prototype, "player", void 0), 
    a([ l(cc.Node) ], t.prototype, "bg", void 0), a([ c ], t);
}(cc.Component);

n.default = d;